import {createSlice} from "@reduxjs/toolkit";

const AbeyanceStore = createSlice({
    name: 'abeyance', // 初始化数据
    initialState: {
        thingList: [], Non_thingList: []
    }, // 同步修改状态
    reducers: {
        // 保存待办列表
        setThingList(state, action) {
            state.thingList = action.payload
        },
        // 保存已完成列表
        setNon_thingList(state, action) {
            state.Non_thingList = action.payload
        }
    }
})

// 解构赋值
const {setThingList, setNon_thingList} = AbeyanceStore.actions
// 异步修改状态


export {setThingList, setNon_thingList}
const reducer = AbeyanceStore.reducer
export default reducer